package com.egao.api.controller.nont;


import com.egao.common.core.damon.constant.UserConstant;
import com.egao.common.core.web.BaseController;
import com.egao.common.core.web.JsonResult;
import com.egao.common.system.entity.User;
import com.egao.common.system.service.OperRecordService;
import com.egao.orderB.entity.Customer;
import com.egao.orderB.service.CustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * api登录相关接口
 * Created by wangfan on 2019-05-29 下午 3:43.
 * http://localhost/swagger-ui.html
 * https://francjc.com:4332/swagger-ui.html
 *
 */
@RequestMapping("/api/nt/customer")
@RestController
@Api(value = "货代",tags = {"货代"})
public class ApiCustomerNtController extends BaseController {

    @Autowired
    private OperRecordService operRecordService;
    @Autowired
    private CustomerService customerService;


    @PostMapping("/listAll")
    @ApiOperation(value = "货代列表",notes = "" +
            "name  货代名称\n" +
            "type 货代类型:车队,货代\n" +
            "state  状态:未审核/已审核\n" +
            "salesman  业务员(我们组织的)\n" +
            "settle  周结,月结\n\n\n\n\n\n" +
            "返回的数据:id int id\n" +
            "organizationId varchar 组织id\n" +
            "name varchar 货代名称\n" +
            "adminUser varchar 管理员帐号\n" +
            "code varchar 货代代码\n" +
            "email varchar email\n" +
            "socialCode varchar 统一社会信用代码\n" +
            "businessLicense varchar 营业执照图片\n" +
            "salesman varchar 业务员(我们组织的)\n" +
            "settle varchar 结算周期(提醒用的)周结,月结\n" +
            "contacts varchar 联系人\n" +
            "contactsPhone varchar 联系人电话\n" +
            "address varchar 组织店址\n" +
            "type 货代类型:车队,货代\n" +
            "state varchar 审核状态: 未审核,已审核\n" +
            "orderNum int 排序\n" +
            "createTime datetime 创建时间\n" +
            "createUser varchar 创建人\n" +
            "updateTime datetime 更新时间\n" +
            "updateUser varchar 更新人\n" +
            "deleted int del(0正常 1删除)",httpMethod = "POST")
    public JsonResult listAll(Customer customer, HttpServletRequest request)  throws Exception{
        return customerService.list(customer, new User(UserConstant.ADMIN_ID));
    }

}
